Skip to content

Add Greek (el) as beta locale#95655

Open
roryabraham wants to merge 19 commits into
mainfrom
rory-657039-greek-locale
Open

Add Greek (el) as beta locale#95655
roryabraham wants to merge 19 commits into
mainfrom
rory-657039-greek-locale

Conversation

@roryabraham

@roryabraham roryabraham commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Adds Greek (el) as a new beta locale. Registers el in LOCALES.ts, wires runtime loading in IntlStore (translations + date-fns locale), maps Apple Sign In's el_GR locale, loads Greek Intl.ListFormat polyfill data, adds a Greek translation prompt/glossary, and generates src/languages/el.ts from en.ts (6,048 strings, zero translation failures). Excludes the generated file from ESLint and cspell, matching every other beta locale's pattern.

This lands the infra prerequisite for Add Greek as a language to E/App, part of the translator-hiring epic #504749. Greek ships as beta: AI-generated, unaudited, no localized emoji keywords — same limitations as de/fr/ja/etc. Promoting to fully-supported happens after expert audit in a follow-up.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/657039
PROPOSAL:

Tests

  1. Start the web dev server.
  2. Sign in and go to Settings > Preferences > Language.
  3. Confirm Ελληνικά appears in the language list.
  4. Select Ελληνικά. Confirm the UI switches to Greek and the "translations generated automatically" hint shows under the Language row.
  5. Navigate to Home, Inbox, and other Account tabs. Confirm nav labels and settings render in Greek with no raw English fallback, no undefined/[object Object], and no missing-key errors.
  6. Switch back to English. Confirm the list re-sorts correctly and English strings are unaffected.
  • Verify that no errors appear in the JS console

Offline tests

N/A — locale files are bundled at build time; no network-dependent behavior changes.

QA Steps

Same as Tests.

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

N/A — web-only locale infra change, no native platform code touched.

Android: mWeb Chrome

N/A — see MacOS: Chrome / Safari for representative web coverage.

iOS: Native

N/A — web-only locale infra change, no native platform code touched.

iOS: mWeb Safari

N/A — see MacOS: Chrome / Safari for representative web coverage.

MacOS: Chrome / Safari image image image image image

roryabraham and others added 7 commits July 8, 2026 18:17
Add el to BETA_LOCALES with Ελληνικά display name.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add el loader to IntlStore (date-fns/locale/el), map el to Apple
Sign In's el_GR locale, and load el Intl.ListFormat polyfill data.

Note: src/languages/el.ts does not exist yet; typecheck passes once
added in a follow-up commit.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add glossary and tone rules for Greek to guide translation
generation (formal register, gender/case agreement).

Co-authored-by: Cursor <cursoragent@cursor.com>
Generate src/languages/el.ts from en.ts via generateTranslations.ts,
using the base and Greek-specific prompts. 6,048 strings translated
with zero failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match the existing pattern for other AI-generated locale files;
still type-checked, just not linted as hand-authored source.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match the existing ignorePaths pattern for other beta locales;
without this, CI spell-check fails on ~10k lines of Greek text.

Co-authored-by: Cursor <cursoragent@cursor.com>
Ελληνικά in LOCALES.ts's LOCALE_TO_LANGUAGE_STRING is hand-written
(not covered by ignorePaths), so it needs a words entry like the
other locales' native display names (Deutsch, Français, etc.).

Co-authored-by: Cursor <cursoragent@cursor.com>
@roryabraham

Copy link
Copy Markdown
Contributor Author

CI failed on two unrelated, pre-existing test failures (both look like date/time-bomb bugs, not caused by this PR's Greek locale changes):

  • test (job 3): tests/unit/ReportSecondaryActionUtilsTest.tsgetSecondaryAction › should include SUBMIT option for admin with only pending transactions — expected true, got false. Run
  • test (job 8): tests/actions/ReportPreviewActionUtilsTest.tsgetReportPreviewAction › canSubmit should return true for expense preview report with only pending transactions — expected "submit", got "view". Run

Both tests use a hardcoded transaction created: '2025-01-01' and appear to depend on the gap between that fixed date and the real current date. Confirmed unrelated to this PR:

  • Reproduces locally on this branch with today's real system date (npx jest tests/unit/ReportSecondaryActionUtilsTest.ts -t "should include SUBMIT option for admin with only pending transactions").
  • main's own last test.yml run (2026-07-01) was green; the regression appeared sometime after that, before this PR's diff (which only touches src/CONST/LOCALES.ts, src/languages/IntlStore.ts, AppleSignInLocales.ts, polyfillListFormat.ts, translation prompts, and the generated el.ts — nothing in ReportSecondaryActionUtils/ReportPreviewActionUtils).

Tracked in Fix flaky test ReportSecondaryActionUtilsTest/ReportPreviewActionUtilsTest.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@dubielzyk-expensify
dubielzyk-expensify self-requested a review July 13, 2026 23:01
Expensify Neue/Mono/New Kansas and the emoji fonts only cover Latin
script and emoji glyphs. With no generic fallback at the end of the
web font stack, glyphs missing from all of them (e.g. Greek) fell
through to the browser's own default font, which is a serif font.

Append a standard system font stack after the emoji fonts so
uncovered scripts render in a sans-serif system font instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

roryabraham and others added 2 commits July 14, 2026 23:46
main gained new copy (Agents, Rillet, onboarding, card statuses, etc.)
since el.ts was generated, breaking typecheck. Regenerate incrementally
against the pre-merge branch tip and manually fix Rillet export value
keys the translator flattened incorrectly.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/LOCALES.ts 100.00% <ø> (ø)
...ents/HTMLEngineProvider/BaseHTMLEngineProvider.tsx 81.69% <100.00%> (ø)
...ts/SignInButtons/AppleSignIn/AppleSignInLocales.ts 0.00% <ø> (ø)
src/pages/inbox/sidebar/NavigationTabBarAvatar.tsx 91.30% <100.00%> (ø)
src/libs/IntlPolyfill/polyfillListFormat.ts 20.00% <0.00%> (-1.43%) ⬇️
...tils/FontUtils/fontFamily/multiFontFamily/index.ts 0.00% <0.00%> (ø)
... and 13 files with indirect coverage changes

@github-actions

This comment has been minimized.

@dubielzyk-expensify

dubielzyk-expensify commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Tested again and that's looking a lot better 👍 cc @Expensify/design for viz

CleanShot 2026-07-16 at 08 25 25@2x

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Wonder if we could shrink this as it's messing with me:

CleanShot 2026-07-16 at 08 26 06@2x

Account is also weird:

CleanShot 2026-07-16 at 08 26 24@2x

I guess it's part of the RSS so it makes sense, but I kinda would still assume the announcement type would be translated. I think we're removing it though so it's fine

CleanShot 2026-07-16 at 08 26 56@2x

@dubielzyk-expensify

Copy link
Copy Markdown
Contributor

Serif font found here:

CleanShot 2026-07-16 at 08 27 37@2x

Same with description on workspace overview:

CleanShot 2026-07-16 at 08 29 00@2x

And domain RHP:

CleanShot 2026-07-16 at 08 30 02@2x

react-native-render-html keeps only the first whitelisted face, so
Greek in RenderHTML lost our system sans-serif fallbacks and rendered
as serif. Remap brand faces to full platform stacks via fallbackFonts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@roryabraham

Copy link
Copy Markdown
Contributor Author

@dubielzyk-expensify I think that newest AdHoc build should fix the pieces of serif font you pointed out. However, I'd love your advice on how to fix the LHN word wrapping issues we were seeing. It sounds like there's no shorter word that would be a natural fit for either Inbox or Account, so that gives us a few options:

  1. Decrease the font size for that text in Greek
    a. For just the items that are too long, OR
    b. For all LHN items for consistency
  2. Widen the LHN. It's 72 pixels and there's kind of a lot of layout math that depends on that. Medium-to-high-effort to widen it to say 80 pixels, but certainly not impossible:
    a. Widen it just for Greek, OR
    b. Widen it for all locales
  3. Embrace the wrapping:
    1. Make sure that Account wraps like Inbox
    2. Insert a zero-width character in the middle of each, so that even though they'll take up two lines, at least we won't have just 1 or 2 characters on their own line.

roryabraham and others added 2 commits July 15, 2026 21:50
Fill missing el.ts keys from main and satisfy ESLint naming on the
HTML font fallback map key for the CSS sans-serif generic family.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

This comment has been minimized.

@dannymcclain

Copy link
Copy Markdown
Contributor

Can't get that most recent ad hoc build to load, but I think letting it wrap is probably fine. Check out Portuguese:
CleanShot 2026-07-16 at 08 07 45@2x

I guess this is a little different since these are single words being split to two lines, but I'd probably vote to let it wrap or just truncate the labels. All the pages have giant page titles on them anyways...

@roryabraham

Copy link
Copy Markdown
Contributor Author

oh, @Expensify/design for the AdHoc to work, you must not have another Expensify tab open (or force it offline). If you have a staging or prod tab open and you switch your preferredLocale NVP to Greek in the AdHoc tab, the prod tab will think "wtf! we don't support this locale" and switch you back.

Εισερχόμενα and Λογαριασμός are too wide for the 72px tab rail.
Add ZWSP break points so they wrap as Εισερχό/μενα and Λογαρια/σμός,
allow Account to use 2 lines like other tabs, and lock the strings in
the Greek glossary so regenerations keep the break points.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

This comment has been minimized.

@dannymcclain

Copy link
Copy Markdown
Contributor

I don't know what the labels translate to in Greek, but they look pretty good 🤷 😂

roryabraham and others added 2 commits July 16, 2026 09:51
main added exportToMultipleAccounts / cardProgramAccount / cardAccount;
regenerate el.ts so typecheck matches en.ts again.

Co-authored-by: Cursor <cursoragent@cursor.com>
@roryabraham
roryabraham marked this pull request as ready for review July 16, 2026 17:18
@roryabraham
roryabraham requested review from a team as code owners July 16, 2026 17:18
@melvin-bot
melvin-bot Bot requested review from abzokhattab and joekaufmanexpensify and removed request for a team and joekaufmanexpensify July 16, 2026 17:18
@melvin-bot

melvin-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

@abzokhattab Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3eef94f6e5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/CONST/LOCALES.ts
*/
const BETA_LOCALES = {
DE: 'de',
EL: 'el',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add native Intl locale data before enabling Greek

When this adds el to the supported locale list, Greek becomes selectable on iOS/Android too, but the native Intl polyfills still only load @formatjs/intl-pluralrules data for en/es in src/libs/IntlPolyfill/index.android.ts and index.ios.ts (and the iOS NumberFormat polyfill likewise only loads en/es). With Greek selected, rendering any pluralized translation in src/languages/el.ts (for example expenseCount) will construct Intl.PluralRules('el') after the forced polyfill has no Greek data loaded, causing missing-locale runtime failures on native; please load the Greek Intl polyfill data alongside making the locale selectable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MelvinBot does this concern affect all locales other than English and Spanish, or just Greek? If it does concern other locales, please create a new GitHub issue in this repo, label it weekly, and assign to me

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This affects all locales other than English and Spanish — not just Greek. The native polyfills hardcode en/es data (index.android.ts:15-17, index.ios.ts:16-18, polyfillNumberFormat.ts:32-34), and this PR only wires up Greek for ListFormat — nothing Greek-specific about the pluralrules/NumberFormat gap. It's a pre-existing issue shared by every beta locale (de, el, fr, it, ja, nl, pl, pt-BR, zh-hans).

One correction to the concern above: @formatjs/intl-pluralrules polyfill-force does not crash on a missing locale — ResolveLocale falls back to the first-loaded default (en). So instead of a runtime failure, non-en/es locales silently use English plural rules:

  • Unaffected in practice: locales sharing English's one/other categories — de, el (Greek is one/other), fr, it, nl, pt-BR, and ja/zh-hans (other only). So Greek's expenseCount will actually render correctly via the en fallback.
  • Actually mis-served today: Polish (pl), which has one/few/many/other — English rules can only ever yield one/other, so its few/many forms never fire. Any future locale with non-English plural categories (Russian, Arabic, Czech…) would hit the same.
  • NumberFormat is only forced on devices with stale ICU, and again only loads en/es.

Filed as #96335, labeled Weekly and assigned to you. Suggested fix in there: load the pluralrules/numberformat data for the active locale dynamically, the same way IntlStore already loads translations, date-fns, and ListFormat data per locale.

@abzokhattab

Copy link
Copy Markdown
Contributor

Hi, is c+ review needed? just confirming before reviewing

@roryabraham

Copy link
Copy Markdown
Contributor Author

Sure @abzokhattab, go for it 👍🏼

roryabraham and others added 2 commits July 17, 2026 11:07
Keep Greek in BETA_LOCALES after French was promoted to fully supported.

Co-authored-by: Cursor <cursoragent@cursor.com>
Incrementally translate keys added since the pre-merge tip.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dannymcclain

Copy link
Copy Markdown
Contributor

REALLY kicking myself that when Rory asked for a design review I didn't reply simply: "It's all Greek to me"

Jeeeeeeeeeeeeeeeeze what a wasted opportunity. I will try to do better.

@github-actions

Copy link
Copy Markdown
Contributor

🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here.

@roryabraham

roryabraham commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

FYI: It's important that this PR be up-to-date with main before it is merged. More important than with other PRs so that we know Greek translations are present for all strings in other languages on main. Not a huge deal if we miss it; it would just cause typecheck to start failing on main, which is a bit disruptive

@abzokhattab

Copy link
Copy Markdown
Contributor

Reviewing after finishing another task today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants